#include "listTemp.h"
#include "company.h"
#include <ctime>
#include <iostream>
#include <chrono>

using namespace std;
using namespace std::chrono;

int main()
{
    // 设置随机数种子
    srand(time(nullptr));
    
    Company cmp;
    
    // 测试较大规模的数据
    int test_sizes[] = {1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000};
    int num_tests = sizeof(test_sizes) / sizeof(test_sizes[0]);
    
    cout << "Performance Test for inputEmployeeHead() vs inputEmployeeTail()" << endl;
    cout << "=============================================================" << endl;
    
    for (int i = 0; i < num_tests; i++) {
        int size = test_sizes[i];
        cout << "\nTesting with " << size << " employees:" << endl;
        
        // 测试 inputEmployeeHead
        auto start = high_resolution_clock::now();
        cmp.inputEmployeeHead(size);
        auto stop = high_resolution_clock::now();
        auto head_duration = duration_cast<milliseconds>(stop - start);
        cout << "  inputEmployeeHead() took: " << head_duration.count() << " ms" << endl;
        
        // 测试 inputEmployeeTail
        start = high_resolution_clock::now();
        cmp.inputEmployeeTail(size);
        stop = high_resolution_clock::now();
        auto tail_duration = duration_cast<milliseconds>(stop - start);
        cout << "  inputEmployeeTail() took: " << tail_duration.count() << " ms" << endl;
        
        cout << "  Difference: " << (tail_duration.count() - head_duration.count()) << " ms" << endl;
    }
    
    return 0;
}